#include <iostream>
#define MAXINT 2147483647

using namespace std;

void selectionSort(int* num, int size)
{
	int temp = 0;
	int min_place = 0;
	for (int i = 0; i < size; i++)
	{
		int min = MAXINT;
		for (int j = i+1; j < size; j++)
		{
			// 找出i之后最小的一个
			if (num[j] <= min)
			{
				min = num[j];
				min_place = j;
			}
		}
		// 最小的数与i处交换
		temp = num[i];
		num[i] = num[min_place];
		num[min_place] = temp;
		// 此后不断选择出余下子数组最小的数
	}
}

int main()
{
	int num[10] = { 85,22,90,76,80,54,3,11,18,4 };
	selectionSort(num, 10);
	for (int i = 0; i < 10; i++)
	{
		if (i == 0)
		{
			cout << num[i];
		}
		else
		{
			cout << "," << num[i];
		}
	}
	cout << endl;
}